﻿<!DOCTYPE html>
<html lang="en">
<#include "../include/resource-head.ftl"/>
<body>
<#assign active='backList'/>
<#include "../include/common-top.ftl"/>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
    <#include "../include/common-menu.ftl"/>
        <div class="main-content">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-search">
                            <form role="form" class="form-inline clearfix" id="form" action="">
                                <div class="input-group col-xs-3">
                                    <span class="input-group-addon">编号</span>
                                    <input type="text" class="form-control" name="no" value="${no!}">
                                </div>
                            </form>
                            <div class="form-tool btn-group">
                                <button class="btn btn-sm btn-success" form="form">
                                    <i class="icon-search"></i>搜索
                                </button>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>收货人</th>
                                    <th>联系方式</th>
                                    <th>收货地址</th>
                                    <th>运输方式</th>
                                    <th>状态</th>
                                    <th>添加时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <#list pageInfo.list as item>
                                <tr>
                                    <td>${item.no}</td>
                                    <td>${item.receiveuser!}</td>
                                    <td>${item.receivephone!}</td>
                                    <td>${item.province!}-${item.city!}-${item.area!}</td>
                                    <td>
                                        <#if 1 == item.trantype!>
                                            <span class="label label-sm label-success">空运</span>
                                        <#else>
                                            <span class="label label-sm label-warning">陆运</span>
                                        </#if>
                                    </td>
                                    <td>
                                        <#if 4 == item.status!>
                                            <span class="label label-sm label-warning">等待审核</span>
                                        <#elseif 5 == item.status>
                                            <span class="label label-sm label-success">审核通过</span>
                                        <#else>
                                            <span class="label label-sm label-danger">审核未通过</span>
                                        </#if>
                                    </td>
                                    <td>${item.addtime?string('yyyy-MM-dd HH:mm:ss')}</td>
                                    <td>
                                        <a class="btn btn-xs btn-primary" href="#"
                                           onclick="tipMsg('${item.receiveaddress!}')">详细地址</a>
                                        <a class="btn btn-xs btn-success" href="#"
                                           onclick="tipMsg('${item.remark!}')">查看备注</a>
                                    </td>
                                </tr>
                                </#list>
                                </tbody>
                            </table>
                        <#include "../include/table-page.ftl"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="wuliu" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="modalAcceptLabel">更新物流信息</h4>
                </div>
                <form class="form-horizontal" name="form" id="form" method="post" action="/logistics/save">
                    <div class="modal-body" id="m-msg">
                        <input type="hidden" name="expressId" id="expressId">
                        <div class="form-group has-info">
                            <label class="col-xs-12 col-sm-3 control-label no-padding-right">我在这</label>
                            <div class="col-xs-12 col-sm-5">
                                <textarea class="autosize-transition form-control" id="remark" name="remark"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary"  onclick="updatewuliu()">提交</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</body>
<#include "../include/resource-script.ftl"/>
<script>
    function updatewuliu(){
        var id = $("#expressId").val();
        var remark = $("#remark").val();
        $.getJSON("/logistics/save",{expressId:id,remark:remark},function(result){
            if(result.code == 200){
                alert("物流信息更新成功");
                location.reload(true);
            }else{
                alert(result.message);
            }
        })
    }
    function wuliu(id){
        $("#expressId").val(id);
        $("#wuliu").modal("show");
    }
</script>
</html>

